<template>
	<view class="page">
		<nav-bar :title="pageTitle" bgColor="#FFF" titleColor="#000"></nav-bar>
		<view class="card">
			<view class="card-item">
				<view class="img-box">
					<image class="img" :src="baseIconUrl + 'icon_smile.png'" alt="" />
				</view>
				<view class="text">
					<view class="first">{{ title }}</view>
					<slot name="content"></slot>
				</view>
			</view>
		</view>
		<view class="button">
			<view class="button-item" @click="clickSure">确定</view>
		</view>
	</view>
</template>

<script>
	import NavBar from '@/components/nav-bar'
	import pageConfig from '@/config'
	export default {
		name: 'successPage',
		components: {
			NavBar
		},
		data() {
			return {
				baseIconUrl: pageConfig.baseIconUrl,
			}
		},
		props: {
			pageTitle: {
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: '恭喜您!'
			}
		},
		methods: {
			clickSure() {
				this.$emit('confirmBtn')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100vh;
		background-color: #fff;

		.card {
			width: 100%;
			margin-top: 260rpx;

			.card-item {
				width: 634rpx;
				margin: auto;
				display: flex;
				flex-direction: column;
				justify-content: center;
				padding-bottom: 64rpx;
				background: linear-gradient(151deg, #F4E8CC 0%, #EAD39D 100%);
				border-radius: 28rpx 28rpx 28rpx 28rpx;
				opacity: 1;

				/* 使用transform属性进行偏移 */

				.img-box {
					margin: 64rpx auto;
					width: 101rpx;
					height: 101rpx;

					.img {
						width: 101rpx;
						height: 101rpx;
					}
				}

				.text {
					width: 100%;
					font-size: 32rpx;
					font-family: Source Han Sans CN, Source Han Sans CN;
					color: #61452C;

					view {
						width: 100%;
						text-align: center;
					}

					.first {
						font-size: 50rpx;
						font-family: Source Han Sans CN, Source Han Sans CN;
						font-weight: 500;
					}
				}
			}
		}

		.button {
			position: fixed;
			width: 100%;
			bottom: 0;
			height: 148rpx;
			opacity: 1;
			background: #FFFFFF;
			// box-shadow: 0rpx -2rpx 13rpx #ADADAD;
			display: flex;
			justify-content: center;
			align-items: center;

			.button-item {
				width: 671rpx;
				height: 94rpx;
				background: linear-gradient(90deg, #EDD3AE 0%, #DCB17F 100%);
				border-radius: 63rpx 63rpx 63rpx 63rpx;
				opacity: 1;
				text-align: center;
				font-size: 30rpx;
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 500;
				line-height: 94rpx;
			}
		}
	}
</style>